package edu.nju.mutest.example.suites;

import edu.nju.mutest.example.Calculator;

/**
 * Demo test suite for {@link Calculator}
 */
public class CalculatorTestSuite3 {

    public static void main(String[] args) {
        testAdd();
        testMul();
        testSub();
    }

    private static void testAdd() {
        int oracle = 7;
        int res = Calculator.add(1, 5);
        if (oracle == res)
            System.out.println("[TEST] testAdd() pass!");
        else
            throw new RuntimeException(String.format("[TEST] testAdd() fail (%d, %d)!", oracle, res));
    }

    private static void testSub() {
        int oracle = 0;
        int res = Calculator.subtract(0, 0);
        if (oracle == res)
            System.out.println("[TEST] testSub() pass!");
        else
            throw new RuntimeException(String.format(
                    "[TEST] testSub() fail (%d, %d)!", oracle, res));
    }

    private static void testMul() {
        int oracle = 0;
        int res = Calculator.multiply(0, 0);
        if (oracle == res)
            System.out.println("[TEST] testMul() pass!");
        else
            throw new RuntimeException(String.format(
                    "[TEST] testMul() fail (%d, %d)!", oracle, res));
    }

}
